extends "../cTDZ_3_1/cTDZ_3_1.gd"
func _info():
	pass

func _connect():
	._connect()
	
func _extInit():
	._extInit()
	chaName = "娜迦国师"
	lv = 3
	attCoe.atk = 25 / 8.5 * 2 / 3
	attCoe.maxHp = 900 / 112.5 / 3
	addCdSkill("njms1",5)
	addSkillTxt("魔网捕捉：投出一张魔网，对当前敌人附加1层<沉默>和<沉睡>[cd:5秒]")
	addCdSkill("njms2",11)
	addSkillTxt("激流冲击：召唤激流，对攻击范围内所有敌人造成150%魔法伤害，并附加1层<破甲>和<魔破>[cd:11秒]")

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "njms1" && aiCha:
		cst("魔网捕捉","000000",position)
		aiCha.addBuff(ctrl.b_chenmo.new(1))
		aiCha.addBuff(ctrl.b_chenshui.new(1))

	if id == "njms2":
		var chas = getAllChas(1)
		for i in chas:
			if inrange(i.cell,cell,att.atkRan):
				i.addBuff(ctrl.b_pj.new(1))
				i.addBuff(ctrl.b_mp.new(1))
				hurtChara(i,att.atk*1.5,Chara.HurtType.MGI,Chara.AtkType.SKILL)

func inrange(a,b,c):
	var x = abs(a.x - b.x)
	var y = abs(a.y - b.y)
	return x*x + y*y <= c*c